package com.ruoyi.platform.system.role.service;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.platform.system.role.pojo.RoleDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 角色信息表
 *
 * @author lcf
 * @version 0.0.1
 * @since 2020-11-16 01:47:41
 */
@ApiModel
@Data
@NoArgsConstructor
public class RoleDTO {
    /**
     * 角色ID
     */
    @ApiModelProperty("角色ID")
    private Long roleId;
    /**
     * 角色名称
     */
    @ApiModelProperty("角色名称")
    private String roleName;
    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public RoleDTO(RoleDO info) {
        if (info != null) {
            this.roleId = info.getRoleId();
            this.roleName = info.getRoleName();
            this.createTime = info.getCreateTime();
        }
    }
}